package org.honeyweb.gsoc.pages;

import java.util.ArrayList;
import java.util.List;

import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.annotations.Service;
import org.apache.tapestry5.annotations.SessionState;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.honeyweb.gsoc.model.Organizations;
import org.honeyweb.gsoc.model.Runs;
import org.honeyweb.gsoc.model.Urls;
import org.honeyweb.gsoc.model.Users;
import org.honeyweb.gsoc.services.RunsManager;
import org.honeyweb.gsoc.services.UrlsManager;

public class Results {
	
	@Inject
	@Service("urlsManager")
	private UrlsManager urlsManager;
	
	@Inject
	@Service("runsManager")
	private RunsManager runsManager;
	
	@SessionState(create=true)
	private Users user;
	
	@Property
	private Urls url;
	
	@Property
	private Runs run;

	public ArrayList<Urls> getUrls(){
		int userId = user.getIdUser();
		ArrayList<Urls> results = new ArrayList<Urls>();
		results = urlsManager.getResults(userId);
		return results;		
	}
	
	public ArrayList<Runs> getRuns(){
		int userId = user.getIdUser();
		ArrayList<Runs> results = new ArrayList<Runs>();
		results = runsManager.getRuns(userId);
		return results;		
	}
	
	
	

}
